﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Net.Browser;

namespace DXTools.Core.Service
{
    public static class ConfigService
    {
        public static WebRequest RetrieveModules(AsyncCallback AsyncCallbackAction)
        {
            Uri serviceUri = new Uri("http://www.dynamicsxrmtools.com/ModulesService.svc/Modules", UriKind.RelativeOrAbsolute);


            JSONRequestCreator requestCreatorJSON = new JSONRequestCreator();

            WebRequest GETRequest = requestCreatorJSON.CreateGET(serviceUri);

            
            GETRequest.BeginGetResponse(AsyncCallbackAction, null);

            return GETRequest;


        }

        public static WebRequest RetrieveModule(String Id,AsyncCallback AsyncCallbackAction)
        {
            Uri serviceUri = new Uri("http://www.dynamicsxrmtools.com/ModulesService.svc/Modules/" + Id, UriKind.RelativeOrAbsolute);


            JSONRequestCreator requestCreatorJSON = new JSONRequestCreator();

            WebRequest GETRequest = requestCreatorJSON.CreateGET(serviceUri);


            GETRequest.BeginGetResponse(AsyncCallbackAction, null);

            return GETRequest;


        }
    }
}
